<!--Descriptive page name, messages and instructions-->
<h2><%= ts("Edit My Profile") %></h2>
<%= error_messages_for :user %>
<%= error_messages_for @user.profile %>
<!--/descriptions-->

<!--subnav-->
<ul class="navigation" role="navigation">
  <li><%= link_to ts("Edit default pseud and icon"), [:edit, @user, @user.default_pseud] %></li>
  <li><%= link_to ts("Change My User Name"), change_username_user_path(@user) %></li>
  <li>
  <% if @user.crypted_password %>
    <%= link_to ts("Change My Password"), change_password_user_path(@user) %>
  <% else %>
    <%= link_to ts("Add a Password"), change_password_user_path(@user) %>
  <% end %>
  </li>
  <% if ArchiveConfig.USE_OPENID %>	
    <li>
    <% if @user.identity_url %>
      <%= link_to ts("Change My OpenID"), change_openid_user_path(@user) %>
    <% else %>
      <%= link_to ts("Add An OpenID"), change_openid_user_path(@user) %>
    <% end %>
    </li>
  <% end %>
</ul>
<!--/subnav-->

<!--main content-->
<%= form_for(@user) do |f| %>  
  <dl>
    <dt><%= label_tag :password_check, ts("Old password") %></dt>
    <dd><%= password_field_tag :password_check%></dd>

    <% if ArchiveConfig.USE_OPENID && @user.identity_url %>	
      <dt><%= label_tag :identity_url_check, ts("OR Current OpenID URL") %></dt>
      <dd><%= text_field_tag :identity_url_check, "", :size => 50 %></strong></dd>
    <% end %>

    <dt><%= label_tag :new_email, "Change Email" %></dt>
    <dd><%= text_field_tag :new_email, @user.email %></dd>
  <%= fields_for :profile_attributes,  @user.profile do |p| %>
     <dt><%= p.label :title, "Title" %></dt>
     <dd>
        <%= p.text_field :title %>
        <%= live_validation_for_field("profile_attributes_title", :presence => false, :maximum_length => Profile::PROFILE_TITLE_MAX) %>      
        <%= generate_countdown_html("profile_attributes_title", Profile::PROFILE_TITLE_MAX) %>
      </dd>

      <dt><%= p.label :location, "Location" %></dt>
      <dd>
        <%= p.text_field :location %>
        <%= live_validation_for_field("profile_attributes_location", :presence => false, :maximum_length => Profile::LOCATION_MAX) %>
        <%= generate_countdown_html("profile_attributes_location", Profile::LOCATION_MAX) %>
      </dd>

      <dt><%= p.label :date_of_birth, "Date of Birth" %></dt>
      <dd><%= p.date_select :date_of_birth, :start_year => 13.years.ago.year, :end_year => 90.years.ago.year, :include_blank => true %></dd>

      <dt><p><%= p.label :about_me, "About Me" %></p></dt>
      <dd class="description">
        <p><code>a href, b, big, blockquote, br, caption, center, cite, code, col, colgroup, del, dd, dt, dl, div, em, h1, h2, h3, h4, h5, h6, hr, i, img, ins, li, ol, p, pre, q, small, span, strike, strong, sub, sup, table, tr, td, th, tbody, thead, tfoot, u, ul</code></p>
<%= p.text_area :about_me %>
        <%= live_validation_for_field("profile_attributes_about_me", :presence => false, :maximum_length => Profile::ABOUT_ME_MAX) %>
        <%= generate_countdown_html("profile_attributes_about_me", Profile::ABOUT_ME_MAX) %>
      </dd>
    </dl>
  <% end %>
	
	
  <p class="submit">
    <%= f.submit "Update" %>
  </p>
<% end %>
<hr class="clear" />
<!--/content-->
